"""This module contains utility functions to work with directories."""

from os.path import abspath, join, dirname, pardir


def up(path, levels=1):
    return abspath(join(dirname(path), *([pardir] * levels)))
